package com.lagou.concurrent.demo;

import java.util.concurrent.CountDownLatch;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch latch = new CountDownLatch(5);
        for (int i = 0; i < 4; i++) {
            new MyThread("线程" + (i + 1), latch).start();
        }

        // main线程等待
        latch.await();
        System.out.println("main线程执行结束");

    }
}
